package com.im.app.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

/**
 * 流水信息对象 flow_record_logs
 *
 * @author ruoyi
 * @date 2023-06-12
 */
@Data
public class FlowRecordLogs {

    private static final long serialVersionUID = 1L;

    public static String CREATE_USER = "登录";
    public static String ACTIVE = "激话";
    public static String DELETED = "删除";
    public static String USE = "使用";
    public static String TEST = "试用";
    public static String HOST = "域名";
    public static String RENEW = "续费";

    /** 主键 */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /** 操作人 */
    private Integer adminId;

    /** 1-开户 2-续费 3-独立 4注销 */
    private String name;

    private Integer totalMoney;
    /** 已使用金额 */
    private Integer useMoney;
    /** 待结算金额 */
    private Integer settlementMoney;
    /** 冻结金额 */
    private Integer luckMoney;

    /** 备注 */
    private String mark;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;


    public static FlowRecordLogs createRecord(Admin admin,String name,String mark){
        FlowRecordLogs flowRecordLogs = new FlowRecordLogs();
        flowRecordLogs.setAdminId(admin.getId());
        flowRecordLogs.setName(name);
        flowRecordLogs.setTotalMoney(admin.getTotalMoney());
        flowRecordLogs.setLuckMoney(admin.getLuckMoney());
        flowRecordLogs.setUseMoney(admin.getUseMoney());
        flowRecordLogs.setSettlementMoney(admin.getSettlementMoney());
        flowRecordLogs.setMark(mark);
        return flowRecordLogs;
    }

}
